name: 'Test'
on:
  pull_request:
    branches: [main]
  push:
    branches: [main]

jobs:
  test:
    name: 'Run Tests 🧪'
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Setup Node
        uses: actions/setup-node@v2
        with:
          node-version: '16.x'
          cache: 'npm'
          cache-dependency-path: '**/package-lock.json'
      - name: Install and build
        run: |
          npm ci
      - name: Run Jest
        run: npm run test
